import { computed, ref } from "vue";
import { defineStore } from "../pinia/index";

export const useStore2 = defineStore("store2", () => {
    const count1 = ref(1);
    const count2 = ref(2);

    const addCount = computed(() => {
        return count1.value + count2.value;
    })

    const count1Add = (payload: number = 1) => {
        count1.value += payload;
    }
    const count2Add = (payload: number = 1) => {
        count2.value += payload;
    }

    return {
        count1,
        count2,
        addCount,
        count1Add,
        count2Add
    }
})